﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XuanFe.Database.Model;

namespace XuanFe.AppLaunch.Common
{
    public class LoginInfo
    {
        private static LoginInfo instance = new LoginInfo();
        /// <summary>
        /// 初始化实例
        /// </summary>
        /// <returns></returns>
        public static LoginInfo Instance
        {
            get
            {
                return instance;
            }
        }

        public string ComputerName { get; set; }
        public string ComputerIP { get; set; }
        public string ComputerMAC { get; set; }
        public StaffLogonModel StaffLogon { get; set; }
        public bool CheckPermission(string functionId)
        {
            return LoginInfo.Instance.StaffLogon.Functions.FindIndex(item => { return string.Equals(item.Id, functionId); }) >= 0;
        }
    }
}
